<html>
	<head>
		<title>Pinnacle Books | Add Item</title>
		<link rel="shortcut icon" href="/public/images/fav.ico" />
		<link rel="stylesheet" href="/public/stylesheets/main.css" type="text/css" media="screen" />
		<script type="text/javascript" src="/public/javascripts/addItem.js" ></script>
		<script type="text/javascript" src="/public/javascripts/jquery-1.6.4.min.js"></script>
		<script>
		function clear_image() {
			$("#book_image").empty();
		}
		
		function lookup() {
			var isbn = $("#isbn").val();
			if(isbn != ""){
				//Reset
				clear_image();
				//Lookup book image
				$("#book_image").append("<img src='http://covers.openlibrary.org/b/isbn/" + isbn + "-M.jpg' />");
				//Display image
				$("#book_image").fadeIn("slow");
			}
			
		}		
		</script>
	</head>

	<body>
		<div id="container">
			<!--Page Header-->
			#{include 'header.html'/}
			
			<!--Page Title-->
			<br /><img src="/public/images/layout/header_admin.jpg" />
			
			<!--Page Content-->
			<div id="content">
				<div id="content_left">
					<div class="title">Add Item</div>
					<div class="left_bar">
					<form id="form1" name="form1" method="get" action="javascript: check()">
						<table>
							<tr>
								<td colspan="2">Please enter your item information:</td>
							</tr>
							<tr>
								<td><label for="title">Title</label></td>
								<td><input type="text" name="title" id="title" size="50" /></td>
							</tr>
							<tr>
								<td><label for="isbn">ISBN</label></td>
								<td><input type="text" name="isbn" id="isbn" onblur="lookup()" /></td>
							</tr>
							<tr>
								<td><label for="description">Description</label></td>
								<td><input type="text" name="description" id="description" size="50" /></td>
							</tr>
							<tr>
								<td><label for="itemPrice">Item Price</label></td>
								<td><input type="text" name="itemPrice" id="itemPrice" onblur="isNaN(this.value)?alert('invalid item price'):''"/></td>
							</tr>
							<tr>
								<td><label for="shippingPrice" onblur="isNaN(this.value)?alert('invalid shipping price'):''" >Shipping Price</label></td>
								<td><input type="text" name="shippingPrice" id="shippingPrice" /></td>
							</tr>
							<tr>
								<td><label for="duartion">Duration</label></td>
								<td>
									<select name="duration" size="1" id="duration">
										<option value="1">3 Days</option>
										<option value="2">10 Days</option>
										<option value="3">30 Days</option>
									</select>
								</td>
							</tr>
							<tr>
								<td colspan="2" align="right">
									<hr />
									<button type="submit" name="addItem" id="addItem">Add New Item</button>
									<button type="reset" onclick="clear_image()">Reset</button>
								</td>
							</tr>	
						</table>
					</form>
					</div>
				</div>
				<div id="book_image"></div>
			</div>
			
			<!--Page Footer-->
			#{include 'footer.html'/}
		</div>
	</body>
</html>